home *** CD-ROM | disk | FTP | other *** search
/ HamCall (October 1991) / HamCall (Whitehall Publishing)(1991).bin / bcast / bcstcble / pad.asc < prev    next >
Text File  |  1990-10-14  |  1KB  |  29 lines

  1. 10 CLS
  2. 15 PRINT"                       AUDIO PAD CALCULATOR "
  3. 16 PRINT" "
  4. 20    A$="": B$=" Each" : C$="" : F=1
  5. 30    A1$=" Series " :B1$=" Shunt ":D$=" Resistor: "
  6. 40    INPUT "   Desired attenuation (dB): ",DB
  7. 50    N=10^(DB/10):NT=(N+1)/(N-1)
  8. 60    INPUT "   Input Impedance:          ",Z1
  9. 70    INPUT "   Output Impedance:         ",Z2
  10. 75    DEF FNA(Z)=F*(Z*NT-R3)
  11. 80    INPUT "   Type (T,H,PI,O):          ",T$
  12. 90    ON INSTR(" HTOPI",T$)+1 GOTO 80,80,100,110,120,130
  13. 100   SWAP A$,B$ : F= .5
  14. 110   R3=2*SQR(N*Z1*Z2)/(N-1) : R1=FNA(Z1):R2=FNA(Z2): GOTO 165
  15. 120   SWAP A$,B$ : F= .5
  16. 130   SWAP A1$,B1$: SWAP A$,C$
  17. 140   R3=(N-1)*SQR(Z1*Z2/N)/2
  18. 150   R1=1/((1/Z1)*NT-1/R3)
  19. 160   R3 =F*R3
  20. 165   PRINT "Loss ";TAB(34) DB
  21. 168   PRINT "In-Out Z ";TAB(34) Z1; "-" ; Z2
  22. 170   R2=1/((1/Z2)*NT-1/R3)
  23. 190   PRINT A$ " Input "A1$ D$ TAB(34) R1
  24. 200   PRINT C$ B1$ D$ TAB(34) R3
  25. 210   PRINT A$ " Output " A1$ D$ TAB(34) R2
  26. 220   PRINT
  27. 230   INPUT "ANOTHER ";A$ : IF LEFT$(A$,1)="Y"GOTO 20
  28. 240   END
  29.